const Router = require('koa-router')
const {appletAuth, wxAppletAuth} = require('../middleware/auth.middleware')
const {commentValidator} = require('../middleware/comment.middleware')
const {addComment, deleteAppletComment, getCommentList} = require('../controller/commentController')

const appletCommentRouter = new Router({prefix: '/applet/comment'})

appletCommentRouter.post('/add', appletAuth, commentValidator, addComment)

appletCommentRouter.post('/wxAdd', wxAppletAuth, commentValidator, addComment)

appletCommentRouter.get('/list', appletAuth, getCommentList)

appletCommentRouter.get('/wxList', wxAppletAuth, getCommentList)

appletCommentRouter.post('/delete/:id', appletAuth, deleteAppletComment)

module.exports = appletCommentRouter;
